<?php

!defined('IN_FENGTOP') && exit('Access Denied');
 
class control extends base{

	function control(& $get,& $post){
		$this->base( & $get,& $post);
		//$this->load('category');
	}

 	function dodefault() {
		$groupSQl = "SELECT * 
FROM  `".DB_TABLEPRE."category` 
WHERE  `fup` =0
AND  `type` =  'group'
ORDER BY  `displayorder` ASC , `fid` ASC ";
		
		$group = $this->db->get_array($groupSQl);
		
		$forumSQl = "SELECT * 
FROM  `".DB_TABLEPRE."category` 
WHERE  `type` =  'forum'
ORDER BY  `fup` ASC , `displayorder` ASC , `fid` ASC ";
		
		$forum = $this->db->get_array($forumSQl);
		
		$subSQl = "SELECT * 
FROM  `".DB_TABLEPRE."category` 
WHERE  `fup` <> 0
AND  `type` <>  'forum'
ORDER BY  `fup` ASC , `displayorder` ASC , `fid` ASC ";
		
		$sub = $this->db->get_array($subSQl);
		
		$this->view->assign('group',$group);
		$this->view->assign('forum',$forum);
		$this->view->assign('sub',$sub);
		
		$this->view->display('treenav.tpl');
	}

}
?>